<%@page import="com.alex.webnote.domain.WebNoteState"%>
<%@page language="java" pageEncoding="UTF-8"%>

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<fmt:setBundle basename="META-INF.message" var="message" />

<html>
<head>
<%@ include file="/jsp/inc/header.jsp"%>
<title><fmt:message key="webnote_edit" bundle="${message}" /></title>

<!-- um begin -->
<link href="/static/um/themes/default/css/umeditor.min.css"
	type="text/css" rel="stylesheet">
<script type="text/javascript" charset="utf-8"
	src="/static/um/umeditor.config.js"></script>
<script type="text/javascript" charset="utf-8"
	src="/static/um/umeditor.min.js"></script>
<script type="text/javascript" src="/static/um/lang/zh-cn/zh-cn.js"></script>
<!-- um over -->

<script type="text/javascript" src="/static/js/webnote.js"></script>
</head>

<body bgcolor="#E0E0E0">
	<%@ include file="/jsp/inc/navbar.jsp"%>
	<div class="sdiv">

		<div
			style="float: left; width: 200px; height: 95%; margin: 2px 2px 2px 2px;">
			<div class="ui-corner-all" style="height: 100%; background: #F5F5F5;">
				<div style="overflow: hidden; height: 20px; margin-left: 3px;">
					<img align="left" src="/static/img/opers.gif" id="add" title="新建"
						style="position: absolute; clip: rect(0px, 60px, 19px, 40px); margin-left: -40px; cursor: pointer;">
					<img align="left" src="/static/img/opers.gif" id="exp" title="导出所有"
						style="position: absolute; clip: rect(0px, 140px, 19px, 120px); margin-left: -100px; cursor: pointer;">
				</div>
				<ul style="list-style: none; margin-left: 3px;">
					<c:forEach items="${webNoteNameIds}" var="webNoteNameId">
						<li><a href="/webnote/find/${webNoteNameId.alias}">${webNoteNameId.name}</a></li>
					</c:forEach>
				</ul>
			</div>
		</div>

		<div id="form" style="float: left; width: 1000px;">
			&nbsp;&nbsp;&nbsp;&nbsp;
			名称：<input id="name" value='<c:out value="${webNote.name}" />'>
			标识：<input id="tagt" value='<c:out value="${webNote.tags}" />' style="width: 240px;">
			<input id="id" type="hidden" value="${webNote.id}">
			<input id="alias" type="hidden" value="${webNote.alias}">
			<input id="author_" type="hidden" value="${webNote.author_}">
			&nbsp;&nbsp;&nbsp;&nbsp;
			<span id="radioset">
				<input type="radio" id="radio1" name="state" value="<%=WebNoteState.PUBLISHED.ordinal()%>" 
					<c:if test='${webNote.state==1}'>checked</c:if> />
				<label for="radio1">公开发表</label>
				<input type="radio" id="radio2" name="state" value="<%=WebNoteState.DRAFT.ordinal()%>"
					<c:if test='${webNote.state==0}'>checked</c:if> />
				<label for="radio2">个人笔记</label>
			</span>
			<button id="save" title="支持 Ctrl+S 快捷键" disabled="disabled" class="ui-state-disabled" onclick="saveNote()">保存</button>
			&nbsp;&nbsp;&nbsp;&nbsp;
			<button id="delete" title="删除">删除</button>
			<!-- ui-dialog -->
			<div id="dialog_simple" title="删除笔记"></div>

			<div
				style="width: 900px; margin: 10px 5px 5px 10px; text-align: left;"
				id="noteContent">
				<script type="text/plain" id="editor"
					style="height: 75%; width: 100%;">${webNote.noteContent}</script>
			</div>
			<script type="text/javascript" src="/static/um/umine.js"></script>

		</div>

	</div>
	<%@ include file="/jsp/inc/footer.jsp"%>
</body>
</html>